#pragma once

namespace Alice
{

/*
    哈希工具
    用来在编译期将字符串转化为哈希值
    来源: https://gist.github.com/Lee-R/3839813
*/
inline constexpr std::uint32_t fnv1a_32(char const *s, std::size_t count) {
	return count ? (fnv1a_32(s, count - 1) ^ s[count - 1]) * 16777619u : 2166136261u;
}

constexpr std::uint32_t operator "" _hash(char const* s, std::size_t count)
{
	return fnv1a_32(s, count);
}

} // namespace Alice
